<template>
  <c-back-wrap :loading="loading" go-page="意向客户跟进管理" current-page="详情">
    <c-title title="基本信息">
      <QupList :column="3" sep="：" default-value="" label-position="right" label-width="130">
        <QupListItem label="意向客户电话" :value="intendedCustomerDTO.customerPhone" />
        <QupListItem label="意向客户姓名" :value="intendedCustomerDTO.customerName" />
        <QupListItem label="性别">
          <c-mdm-view :value="intendedCustomerDTO.customerSex!==undefined?intendedCustomerDTO.customerSex.toString():''" :label="intendedCustomerDTO.customerSexName" doc-code="QY020" />
        </QupListItem>
        <QupListItem label="年龄" :value="intendedCustomerDTO.customerAge" />
        <QupListItem label="身份证号" :value="intendedCustomerDTO.customerIdcard" />
        <QupListItem label="是否有店面" :value="intendedCustomerDTO.isHaveShop" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="店面总面积" :value="`${intendedCustomerDTO.shopArea || 0}㎡`" />
        <QupListItem label="意向经营业务">
          <c-mdm-view :value="intendedCustomerDTO.intendedBusiness" :label="detail.intendedBusinessName" doc-code="QY037" />
        </QupListItem>
        <QupListItem label="意向加盟城市" :value="intendedCustomerDTO.intendedCity" />
        <QupListItem label="客户来源" :value="intendedCustomerDTO.customerSource" dict-type-code="CTM_TOBE_CUSTOMER_DATA_FROM" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="所属办事处" :value="intendedCustomerDTO.agencyName" />
        <QupListItem label="特别备注" :value="intendedCustomerDTO.specialRemarks" :span="24" />
        <QupListItem label="来源渠道" :value="intendedCustomerDTO.channel" dict-type-code="CTM_POTENTIAL_CUSTOMER_SOURCE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="意向客户分配时间" :value="intendedCustomerDTO.allotTime" />
        <QupListItem label="创建人" :value="intendedCustomerDTO.createBy" />
        <QupListItem label="创建时间" :value="intendedCustomerDTO.createTime" />
        <QupListItem label="修改人" :value="intendedCustomerDTO.lastUpdateBy" />
        <QupListItem label="修改时间" :value="intendedCustomerDTO.lastUpdateTime" />
      </QupList>
    </c-title>
    <c-title title="跟进明细">
      <QupList :column="3" sep="：" default-value="" label-position="right" label-width="130">
        <QupListItem label="跟进方式" :value="ctmFranchiseMarketDTO.followUpType" dict-type-code="CTM_FOLLOW_UP_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="招商经理" :value="ctmFranchiseMarketDTO.managerName" />
        <QupListItem label="招商经理电话" :value="ctmFranchiseMarketDTO.managerPhone" />
        <QupListItem label="意向等级">
          <Tip>
            <div slot="tip">
              A类：确定与全友合作意向，有合作实力，有合适口岸，可快速签约；<br>
              B类：明确与全友合作意向，但可能资金不足或口岸不达标；<br>
              C类：有明确投资意向，对全友或其他竞品品牌；
            </div>
            <c-dict-range-view :value="intendedCustomerDTO.intendedLevel" dict-type-code="CTM_INTENTION_LEVEL" domain-code="marketing" app-code="slm" />
          </Tip>
        </QupListItem>
        <QupListItem label="现经营品牌/行业资历" :value="intendedCustomerDTO.industryQualification" :span="24" />
        <QupListItem label="意向开店面积" :value="`${intendedCustomerDTO.intendedShopArea || 0}㎡`" />
        <QupListItem label="跟进进度" :value="ctmFranchiseMarketDTO.followUpStage" dict-type-code="CTM_INTEND_CUS_FOLLOW_UP_PROGRESS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="跟进说明" :value="ctmFranchiseMarketDTO.description" :span="24" />
        <QupListItem label="意向商家情况描述" :value="ctmFranchiseMarketDTO.intendedMerchantDescription" :span="24" />
      </QupList>
    </c-title>
    <c-title title="特许经营市场">
      <QupList :column="3" sep="：" default-value="" label-position="right" label-width="130">
        <QupListItem label="市场编码" :value="ctmFranchiseMarketDTO.marketCode" />
        <QupListItem label="市场名称" :value="ctmFranchiseMarketDTO.marketName" />
        <QupListItem label="省份" :value="ctmMarketDTO.provinceName" />
        <QupListItem label="城市" :value="ctmMarketDTO.cityName" />
        <QupListItem label="区县" :value="ctmMarketDTO.districtName" />
        <QupListItem label="乡镇/街道" :value="ctmMarketDTO.streetName" />
        <QupListItem label="市场类型" :value="ctmMarketDTO.marketType" dict-type-code="TOBE_MARKET_TYPE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="城市级别" :value="ctmMarketDTO.cityLevel" dict-type-code="CITY_LEVEL" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="是否老商家" :value="ctmMarketDTO.isOldMerchant" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="是否有场地" :value="ctmFranchiseMarketDTO.isSite" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="场地详细地址" :value="ctmFranchiseMarketDTO.address" :span="24" />
        <QupListItem label="是否缴纳意向保证金" :value="ctmFranchiseMarketDTO.isPayEarmestMoney" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem v-if="[1,'1'].includes(ctmFranchiseMarketDTO.isPayEarmestMoney)" label="意向保证金缴纳时间" :value="$trimHMS(ctmFranchiseMarketDTO.payEarmestMoneyTime)" />
        <QupListItem label="加盟状态" :value="ctmFranchiseMarketDTO.joinStatus" dict-type-code="CTM_JOIN_IN_STATE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem v-if="ctmFranchiseMarketDTO.joinStatus==='D'" label="意向客户终止跟进原因" :value="ctmFranchiseMarketDTO.terminateDescription" label-width="140px" :span="24" />
        <QupListItem label="是否有需要办事处协助解决的问题" :value="ctmFranchiseMarketDTO.isAgencyProblemHanding" label-width="200px" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem v-if="[1,'1'].includes(ctmFranchiseMarketDTO.isAgencyProblemHanding)" label="需要办事处协助解决的问题说明" :value="ctmFranchiseMarketDTO.agencyProblemHandingMsg" label-width="200px" :span="24" />
        <QupListItem label="招商政策及前期的招商承诺" :value="ctmFranchiseMarketDTO.investmentCommitment" label-width="200px" :span="24" />
        <QupListItem label="市场信息附件" label-width="200px" :span="24">
          <c-file-list :uploadable="false" :editable="false" :model-id="id" view-type="list" type-code="ACCESS049" />
        </QupListItem>
      </QupList>
    </c-title>
    <c-title title="市场建设跟进结果">
      <QupList :column="3" sep="：" default-value="" label-position="right" label-width="190">
        <QupListItem label="办事处负责人审批意见" :value="ctmMarketBuildFollowUpResultDTO.agencyApprovalOpinion" :span="24" />
        <QupListItem label="招商项目负责人审批意见" :value="ctmMarketBuildFollowUpResultDTO.investmentApprovalOpinion" :span="24" />
        <QupListItem label="客户经理账号" :value="ctmMarketBuildFollowUpResultDTO.customerManagerAccount" />
        <QupListItem label="客户经理名称" :value="ctmMarketBuildFollowUpResultDTO.customerManagerName" />
        <!-- <QupListItem label="客源是否有异议" :value="ctmMarketBuildFollowUpResultDTO.isCustomerSourceObjection" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" /> -->
        <!-- <QupListItem label="特许经营市场是否已有其他商家" :value="ctmMarketBuildFollowUpResultDTO.isOhterCustomer" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" /> -->
        <QupListItem label="客户经理初步确认情况" :value="ctmMarketBuildFollowUpResultDTO.customerManagerInitialConfirmation" :span="24" />
        <QupListItem label="客户经理跟进结果确认" :value="ctmMarketBuildFollowUpResultDTO.customerManagerFollowUp" :span="24" />
        <QupListItem label="办事处协助解决问题回复" :value="ctmMarketBuildFollowUpResultDTO.agencyReplyHandlingComments" :span="24" />
        <QupListItem label="交接提报时间" :value="ctmMarketBuildFollowUpResultDTO.handoverPresentationTime" />
        <QupListItem label="客源及市场确认时间" :value="ctmMarketBuildFollowUpResultDTO.marketConfirmTime" />
        <QupListItem label="客户经理初步确认时间" :value="ctmMarketBuildFollowUpResultDTO.customerManagerInitialConfirmationTime" />
        <QupListItem label="交接完成时间" :value="ctmMarketBuildFollowUpResultDTO.handoverCompleteTime" />
        <QupListItem label="BPM单号" :value="ctmMarketBuildFollowUpResultDTO.bpmNumber" />
        <QupListItem label="BPM审核意见" :value="ctmMarketBuildFollowUpResultDTO.bpmAuditOpinion" :span="24" />
        <QupListItem label="客户编码" :value="ctmMarketDTO.customerCode" />
        <QupListItem label="客户名称" :value="ctmMarketDTO.customerName" />
        <QupListItem label="门店建设项目号" :value="ctmMarketDTO.shopBuildNumber" />
        <QupListItem label="门店建设整体进度" :value="ctmMarketDTO.shopBuildStage" dict-type-code="BEFORE_CONST_SCHEDULE" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="是否已建档" :value="ctmFranchiseMarketDTO.isFiling" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
        <QupListItem label="建档时间" :value="ctmFranchiseMarketDTO.filingTime" />
      </QupList>
    </c-title>
    <div class="btn-center">
      <c-button type="primary" @click="handleGoBack">返回</c-button>
    </div>
  </c-back-wrap>
</template>
<script>
import { potentialCustomerFollowUpDetail } from '@/api/channelTask2/potentialCustomerFollowUp'
import Tip from '@/components/Tip'
export default {
  name: 'Detail',
  components: {
    Tip
  },
  props: {
    id: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      detail: {},
      loading: false
    }
  },
  computed: {
    ctmFranchiseMarketDTO() {
      return this.detail.ctmFranchiseMarketDTO || {}
    },
    ctmMarketBuildFollowUpResultDTO() {
      return this.detail.ctmMarketBuildFollowUpResultDTO || {}
    },
    intendedCustomerDTO() {
      return this.detail.intendedCustomerDTO || {}
    },
    ctmMarketDTO() {
      return this.detail.ctmMarketDTO || {}
    },
    marketFiles() {
      return this.detail.marketFiles || []
    }
  },
  created() {
    this.getDetailData()
  },
  methods: {
    getDetailData() {
      this.loading = true
      return potentialCustomerFollowUpDetail(this.id).then(res => {
        this.detail = res.data
      }).finally(() => {
        this.loading = false
      })
    },
    handleGoBack() {
      this.$pageStack.pop()
    }
  }
}
</script>
